//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<ILive.h>
///	@path	~/src/scene/
///	@date	2007/11/02
///	@desc	Interface of all living objects in scene.

#pragma once

#include "xeres.h"

#include "object/IObject.h"

#include "graphics/IRenderer.h"
#include "graphics/animation/frame.h"

#include "scene/resource/ResourceLoader.h"

namespace xeres {

	// forward declaration
	class IScene;
	class ILiveControl;
	class ILivePresent;
	class ScenePresentation;

	/*!
		\class	ILive
		\brief	Interface of all living objects in scene.
	*/
	class ILive : public IObject
	{
	public:

		/// \name Constructor & Destructor
		//@{

		/// \ctor
		ILive( void );

		/// \dtor
		virtual ~ILive( void );

		//@}

		DECL_IOBJECT_INTERFACE( ILive , IObject );

	public:

		/// \name ILive Interface
		//@{

		/*! 
			\brief		Construct live object.
		*/
		virtual void Construct( ResourceLoader * loader , RefWeak<IData> res ) = 0;

		/*! 
			\brief		AttachModel
		*/
		virtual void AttachModel( RefWeak<IModel> model ) = 0;

		/*!
			\brief		Called when entity is placed into a scene.
		*/
		virtual void EnterScene( RefWeak<IScene> scene ) = 0;

		/*!
			\brief		Called when entity is going to leave the scene.
		*/
		virtual void LeaveScene( RefWeak<IScene> scene ) = 0;

		/*!
			\brief		Tick update entity.
		*/
		virtual void Tick( const Frame & frame ) = 0;

		/*!
			\brief		Make presentation of live. (presentation will be rendered)
		*/
		virtual void Present( ScenePresentation& sp ) = 0;

		//@}
	};

} // namespace xeres
